<?php

class Danh_muc extends \Phalcon\Mvc\Model
{
    public $id;
    public $vg_dm_id;
    public $vg_dm_name;
    public $dm_cha_ids;
    public $tong_sp;
    public $ngay_cn;
    
    public function initialize()
    {
        $this->setSource("danh_muc");
    }

    public function getChilds()
    {
        $result = false;

        if($this->id) {
            $childs = self::find("dm_cha_ids LIKE '%$this->vg_dm_id%'");
            if(count($childs)) {
                $result = $childs;
            }
        }

        return $result;
    }
}
?>